package com.example.demo1;

public class Test1 {
    public static void main(String[] args) {
        One<Integer> integerOne = new One<>();
        integerOne.setFan(123);
        fun(integerOne);

        One<String> stringOne = new One<>();
        stringOne.setFan("dsadw");
        fun(stringOne);

        One<Boolean> booleanOne = new One<>();
        booleanOne.setFan(true);
        fun(booleanOne);

    }
    public static void fun(One<?> one){
        one.AAA();
    }
}
class One<T>{
    private T Fan;

    public void AAA(){
        System.out.println("Fan = " + Fan);
    }

    public T getFan() {
        return Fan;
    }

    public void setFan(T fan) {
        Fan = fan;
    }
}
